package org.datascooter.meta;

import java.io.Serializable;
import java.sql.ResultSet;
import java.sql.SQLException;

public class MetaLink implements Serializable {

	private static final long serialVersionUID = 5942478622706419331L;
	public final String PKTABLE_CAT;
	public final String PKTABLE_SCHEM;
	public final String PKTABLE_NAME;
	public final String PKCOLUMN_NAME;
	public final String FKTABLE_CAT;
	public final String FKTABLE_SCHEM;
	public final String FKTABLE_NAME;
	public final String FKCOLUMN_NAME;
	public final String FK_NAME;
	public final String PK_NAME;
	public final int KEY_SEQ;
	public final int UPDATE_RULE;
	public final int DELETE_RULE;
	public final int DEFERRABILITY;

	public MetaLink(ResultSet rs) throws SQLException {
		PKTABLE_CAT = rs.getString("PKTABLE_CAT");
		PKTABLE_SCHEM = rs.getString("PKTABLE_SCHEM");
		PKTABLE_NAME = rs.getString("PKTABLE_NAME");
		PKCOLUMN_NAME = rs.getString("PKCOLUMN_NAME");
		FKTABLE_CAT = rs.getString("FKTABLE_CAT");
		FKTABLE_SCHEM = rs.getString("FKTABLE_SCHEM");
		FKTABLE_NAME = rs.getString("FKTABLE_NAME");
		FKCOLUMN_NAME = rs.getString("FKCOLUMN_NAME");
		FK_NAME = rs.getString("FK_NAME");
		PK_NAME = rs.getString("PK_NAME");
		KEY_SEQ = rs.getInt("KEY_SEQ");
		UPDATE_RULE = rs.getInt("UPDATE_RULE");
		DELETE_RULE = rs.getInt("DELETE_RULE");
		DEFERRABILITY = rs.getInt("DEFERRABILITY");
	}
}
